package Observer;

import java.util.List;

public abstract class Subject {
    private List<Observer> observers;

    public abstract void attach(Observer observer);

    public abstract void detach(Observer observer);

    public void notifyAllObservers() {
        for (Observer observer : observers) {
            observer.update();
        }
    }
}
